import request from './request'
import qs from 'qs'
// export const bindWePhoneApi = (params) => request.post('/wechatUsers/binding', qs.stringify(params) )

// 发送验证码
export const SendCodeApi = (params) => request.get(`/captcha/sent`,{params} )

// 验证验证码 /captcha/verify
export const YzCodeApi = (params) => request.get('/captcha/verify', { params })

// 检测手机号码是否已注册 /cellphone/existence/check
export const phoneisloginApi = (params) => request.get('/cellphone/existence/check', { params })

//  是否从名 /nickname/check
export const useaNamerepeatApi = (params) => request.get('/nickname/check', { params })

// 是否登录 /login/status
export const isLoginApi = () => request.get('/login/status')

// 手机登录 /login/cellphone
// export const goPasswordApi = (params) => request.get('/login/cellphone',{params})

export const goPasswordApi =(phone,num)=> request.post(`/login/cellphone?phone=${phone}&password=${num}`);
// 轮播
export const lunboApi = () => request.get('/banner')

//热门推荐 /personalized/mv
export const HotApi = (params) => request.get('/personalized',{params})

//新品上架
export const newMusicApi = () => request.get('/album/newest')

// 热门歌手 
export const reqArtistsApi = (limit=50,offset=0)=>request.get(`/top/artists?offset=${offset}&limit=${limit}`);

// 最热主播榜 /dj/toplist/popular
export const reqDjTopListApi = (limit = 30)=>request.get(`/dj/toplist/popular?limit=${limit}`);


// 获取所有榜单
export const GetAllMusicListApi = () => request.get('/toplist')

// 获取表单上的所有歌曲
export const GeiListApi = (params) => request.get(`/playlist/track/all?id=${params}`);

// 获取歌单评论 /comment/playlist
export const reqCommentPlayListApi = (id,limit=20,offset=0)=> request.get(`/comment/playlist?id=${id}&limit=${limit}&offset=${offset}`);

// 获取用户歌单 /user/playlist
export const reqUserPlayListApi = (uid)=>request.get(`/user/playlist?uid=${uid}`)

// 用户歌单详情 /playlist/detail
export const reqPlayListDetailApi =(id,)=>request.get(`/playlist/detail?id=${id}`);

// 获取音乐url /song/url
export const reqSongUrlApi = (id)=>request.get(`/song/url?id=${id}`);

// 获取歌单详情 /playlist/detail?id=
export const reqPlayListApi = (id)=>request.get(`/playlist/detail?id=${id}`);
// 歌单列表
export const reqSong = (ids)=>request.get(`/song/detail?ids=${ids}`);
// 网友歌单
export const songseetsApi = (limit=50,order='new',cat='全部',offset=0) => request.get(`/top/playlist?limit=${limit}&order=${order}&cat=${cat}&offset=${offset}`);

// 获取分类
export const reqListApi = ()=>request.get('/playlist/catlist');

// 获取电台分类 /dj/catelist
export const reqCateListapi = ()=>request.get('/dj/catelist');

// 获取电台
export const reqDjRadioHotApi =  (cateId,limit = 30,offset=0)=>request.get(`/dj/radio/hot?cateId=${cateId}&limit=${limit}&offset=${offset}`);

// 推荐电台
export const reqPorgramRecommendApi = ()=>request({url:'/program/recommend',methods:'GET'});
// 分类歌手
export const reqArtistsListapi = (type=-1,area=-1,initial=-1,limit=30,offset=0)=>request.get(`artist/list?type=${type}&area=${area}&initial=${initial}&limit=${limit}&offset=${offset}`);

// 最新专辑 
export const reqAlbumNewsetApi = ()=>request.get("/album/newest");

// 获取专辑内容 /album
export const reqAlbumsApi = (limit=10,offset=0,area,type)=>request({url:`/top/album?offset=${offset}&limit=${limit}&area=${area}&type=${type}`,method:'GET'});

// 搜索建议 /search/suggest?keywords=海阔天空
export const reqSerachSuggestApi = (keywords) => request.get(`/search/suggest?keywords=${keywords}`);

// 搜索 /cloudsearch
export const reqCloudSearchApi = (keywords,type,limit=30,offset=0,cookie) =>  request.get(`/cloudsearch?keywords=${keywords}&type=${type}&limit=${limit}&offset=${offset}&cookie=${cookie}`);
